<!DOCTYPE HTML>
<html class="butler">
<head>
    <title>科寓共享家</title>
    <% include common/meta.ejs %>
    <% include common/public.ejs %>
    <style>
        .weui_grid_icon{
            width: 28px;
            height: 28px;
            margin: 0 auto;
            padding: 18px;
            background: red;
            border-radius: 50px;
            position: relative;
        }
        .weui_grid_icon img{
            width: 28px;
            height: 28px;
        }
        .weui_grid_icon .count{
            width: 18px;
            height: 18px;
            position: absolute;
            top: -5px;
            right: -5px;
            background: rgb(236, 132, 40);
            color: #fff;
            text-align: center;
            line-height: 18px;
        }

    </style>
</head>
<body>
<div class="banner">
    <% let list = data.list;
         console.log(list);
    %>
    <a href="butlerHouse">
        <h1><%= list.totalHouseCnt %></h1>
        <h2>总房屋数</h2>
    </a>
    <div class="weui-row weui-no-gutter">
        <div class="weui-col-25">
            <a href="butlerHouse?status=2">
                <h5><%= list.rentedHouseCnt %></h5>
                <h5>已出租数</h5>
            </a>
        </div>
        <div class="weui-col-25">
            <a href="butlerHouse?status=1">
                <h5><%= list.emptyHouseCnt %></h5>
                <h5>空房数</h5>
            </a>
        </div>
        <div class="weui-col-25">
            <a href="butlerHouse?status=2&&checkoutLimit=day_5">
                <h5><%= list.checkoutHouseCnt %></h5>
                <h5>即将退房</h5>
            </a>
        </div>
        <div class="weui-col-25">
            <a href="butlerHouse?status=2&&payLimit=day_5">
                <h5><%= list.overdueBillCnt %></h5>
                <h5>即将缴费</h5>
            </a>
        </div>
    </div>
</div>

<div class="weui_grids">
    <a href="butlerInstrument" class="weui_grid js_grid" data-id="button" id="butlerInstrument">
        <div class="weui_grid_icon" style="background:rgb(240, 162, 69)">
            <img src="<%= global.config.publicPath %>/page/images/icon/butler/instrument.png" alt="">
            <i class="count"><%= list.checkMeterCnt %></i>
        </div>
        <p class="weui_grid_label">
            抄表处理
        </p>
    </a>
    <a href="butlerFix" class="weui_grid js_grid" data-id="cell" id="butlerFix">
        <div class="weui_grid_icon" style="background:rgb(99, 225, 163)">
            <img src="<%= global.config.publicPath %>/page/images/icon/butler/fix.png" alt="">
            <i class="count"><%= list.repairCnt %></i>
        </div>
        <p class="weui_grid_label">
            报修处理
        </p>
    </a>
    <a href="butlerClean" class="weui_grid js_grid" data-id="toast" id="butlerClean">
        <div class="weui_grid_icon" style="background:rgb(228, 88, 102)">
            <img src="<%= global.config.publicPath %>/page/images/icon/butler/clean.png" alt="">
            <i class="count"><%= list.cleanCnt %></i>
        </div>
        <p class="weui_grid_label">
            保洁处理
        </p>
    </a>
    <a href="butlerBook" class="weui_grid js_grid" data-id="toast" id="butlerBook">
        <div class="weui_grid_icon" style="background:rgb(117, 130, 229)">
            <img src="<%= global.config.publicPath %>/page/images/icon/butler/book.png" alt="">
            <i class="count"><%= list.makeAppointmentCnt %></i>
        </div>
        <p class="weui_grid_label">
            预约管理
        </p>
    </a>
    <a href="butlerHouse" class="weui_grid js_grid" data-id="toast" id="butlerHouse">
        <div class="weui_grid_icon" style="background:rgb(80, 178, 226)">
            <img src="<%= global.config.publicPath %>/page/images/icon/butler/house.png" alt="">

        </div>
        <p class="weui_grid_label">
            房屋管理
        </p>
    </a>
    <a href="butlerHouse?status=2&&checkoutLimit=day_5" class="weui_grid js_grid" data-id="toast" id="butlerHouseCheckout">
        <div class="weui_grid_icon" style="background:rgb(228, 100, 156)">
            <img src="<%= global.config.publicPath %>/page/images/icon/butler/checkout.png" alt="">
            <i class="count"><%= list.checkoutHouseCnt %></i>

        </div>
        <p class="weui_grid_label">

            退房处理
        </p>
    </a>
    <a href="butlerBill" class="weui_grid js_grid" data-id="button" id="butlerBill">
        <div class="weui_grid_icon" style="background:rgb(240, 162, 69)">
            <img src="<%= global.config.publicPath %>/page/images/icon/butler/instrument.png" alt="">
            <i class="count"><%= list.billCnt %></i>
        </div>
        <p class="weui_grid_label">
            账单处理
        </p>
    </a>
    <a href="butlerUser" class="weui_grid js_grid" data-id="toast" id="butlerUser">
        <div class="weui_grid_icon" style="background:rgb(136, 152, 235)">
            <img src="<%= global.config.publicPath %>/page/images/icon/butler/customer.png" alt="">
            <i class="count"><%= list.userCnt %></i>

        </div>
        <p class="weui_grid_label">
            会员管理
        </p>
    </a>
    <a href="contractManager" class="weui_grid js_grid" data-id="toast" id="contractManager">
        <div class="weui_grid_icon" style="background:rgb(136, 152, 235)">
            <img src="<%= global.config.publicPath %>/page/images/icon/butler/customer.png" alt="">
        </div>
        <p class="weui_grid_label">
            合同管理
        </p>
    </a>
</div>
<!--处理页面刷新-->
<input type="hidden" id="refreshed" value="no">
<script>
    window.onload=function(){
        var e=document.getElementById("refreshed");
        if(e.value=="no")e.value="yes";
        else{e.value="no";location.reload();}
    }
</script>
<% include common/footer.ejs %>
<script>
    $(document).ready(function () {
        Dolphin.ajax({
            url: CTX+'/api/5b90151b418f4ceb9469a6b265b0d617@id='+`${ContextData.userData.id}`,
            type: Dolphin.requestMethod.GET,
            forceUrl:'true',
            onSuccess: function(reData){
                let userType = reData.value.userType;
                if(userType=='4'){
//                    $('#butlerBill').css({"display":"none"});
                    $('#butlerHouseCheckout').css({"display":"none"});
                    $('#butlerBook').css({"display":"none"});
                    $('#butlerClean').css({"display":"none"});
                    $('#butlerFix').css({"display":"none"});
                    $('#butlerInstrument').css({"display":"none"});
                }
            }
        })
    })
</script>
<!--<script>
    $(document).ready(function(){
        let id='<%= userData.id %>';
        Dolphin.ajax({
            url: '/api/5b90151b418f4ceb9469a6b265b0d617@id='+id,
            type: 'get',
            forceUrl: 'true',
            onSuccess: function (reData) {
                console.log(reData);
                if(reData.value.userType == 1){
                    $('#butlerBill').show();
                    $('#butlerHouseCheckout').show();
                    $('#butlerBook').show();
                    $('#butlerClean').show();
                    $('#butlerFix').show();
                    $('#butlerInstrument').show();
                }
            }
        });
    })
</script>-->
</body>
</html>